import BaseView from "../../../cfw/mvc/BaseView";
import HouseController from "../HouseController";
import CaptureComp from "../../../engine/comps/CaptureComp";
import SDKManager from "../../../sdk/SDKManager";
import ModuleManager, { ModuleID } from "../../../cfw/module/ModuleManager";
import { SDKEventName } from "../../../sdk/SDKConfig";


const { ccclass, property } = cc._decorator;

@ccclass
export default class OutDoorView extends BaseView {

    @property(CaptureComp)
    capture: CaptureComp = null;
    protected controller: HouseController;
    start() {

    }

    onDestroy() {
        super.onDestroy()
        cc.warn('OutDoorView onDestroy')
        if (this.controller.isGotoLobby()) {
            ModuleManager.getLoader(ModuleID.OUT_DOOR).release()
        }
       

    }

    onButtonSnowClick() {
        this.controller.intoSnowRoom()
    }

    onButtonPaintBoxClick() {
        this.controller.intoHouse()
    }

    onButtonBackClick() {
        this.controller.intoLobby()
    }

    onButtonSnowManClick() {
        this.controller.intoSnowRoom()
    }

    onButtonCaptureClick() {
        SDKManager.getChannel().showScreenshot(this.capture.getTextureHelper())
    }
}
